﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_Product_Detail : System.Web.UI.UserControl
{
   
    SanPham sp = new SanPham();
    protected void Page_Load(object sender, EventArgs e)
    {
        //sp.CT(Request.QueryString.Get("Ten_SP"));
        //lblTenSP.Text = sp.Ten_SP.ToString();
        //lblGia.Text = sp.Gia.ToString();
        //if (sp.So_luong > 0)
        //    lblSoLuong.Text = "Còn " + sp.So_luong.ToString() + " sản phẩm";
        //else lblSoLuong.Text = "Đã hết hàng";
        //imgSP.ImageUrl = "~" + sp.Hinh.ToString();
    }

    protected void btnThemVaoGioHang_Click(object sender, EventArgs e)
    {
        //gh = new Cart();
        //DataTable tb;
        //if (Session["GioHang"] == null)
        //    tb = gh.setTable();
        //else
        //    tb = (DataTable)Session["GioHang"];
        //DataTable dt = gh.giohang(lblTenSP.Text);
        //foreach (DataRow dr in dt.Rows)
        //{
        //    tb = gh.dienVaoBang(tb, dr["hinh"].ToString(), dr["ten_SP"].ToString(), 1, double.Parse(dr["gia"].ToString()), dr["maSP"].ToString());
        //    Session["GioHang"] = tb;
        //}
        
    }
    protected void btnMua_Click(object sender, EventArgs e)
    {

    }
}